package org.business.accounting.components;

import java.util.Locale;

import org.apache.tapestry5.corelib.components.ActionLink;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.PersistentLocale;

@SuppressWarnings("unused")
public class LanguageSwitcher {
	
	@Inject 
	private PersistentLocale persistentLocale;
	
	@Inject
	private Locale currentLocale;
	
	void onAction() {
		if (currentLocale.equals(new Locale("de"))) {
			persistentLocale.set(Locale.ENGLISH);
		}
		else {
			persistentLocale.set(new Locale("de"));
		}
	}

}
